﻿using M_Quality.API.Application.Command.QualityPlanCommand;
using M_Quality.Repository.Interface;
using MediatR;

namespace M_Quality.API.Application.CommandHandler.QualityPlanCommandHandler
{
    /// <summary>
    /// 修改质检方案
    /// </summary>
    public class QualityPianUpdateCommandHandler : IRequestHandler<QualityPianUpdateCommand, int>
    {
        protected readonly IQualityPlanRepositry _qualityPlanRepositry;

        public QualityPianUpdateCommandHandler(IQualityPlanRepositry qualityPlanRepositry)
        {
            _qualityPlanRepositry = qualityPlanRepositry;
        }
        public async Task<int> Handle(QualityPianUpdateCommand request, CancellationToken cancellationToken)
        {
            return await _qualityPlanRepositry.UpdateAsync(request);
        }
    }
}
